package org.itstack.demo.design;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public abstract class NetMail {

    protected Logger logger = LoggerFactory.getLogger(NetMail.class);

    String uId;
    String uPwd;

    public NetMail(String uId, String uPwd) {
        this.uId = uId;
        this.uPwd = uPwd;
    }

    /**
     * 生产产品推广海报
     * @param skuUrl
     * @return
     */
    public String generateGoodsPoster(String skuUrl) {
        if (!login(uId, uPwd)) return null; // 验证登录
        Map<String, String> reptile = reptile(skuUrl); // 爬虫商品
        return createBase64(reptile); // 组装海报
    }

    protected abstract boolean login(String uId, String uPwd);

    protected abstract Map<String, String> reptile(String skuUrl);

    protected abstract String createBase64(Map<String, String> reptile);


}
